<?php
 /**
  *
  * motionWeb | A webUI for motion.
  * Copyright (c) 2010-2011 Kyle Hotchkiss Productions
  * Licenced under the GPL.
  *
  * index.php
  *  Site overhead / routing.
  *
  */
 
 define("motionWeb", ".1-dev"); # Version.
 define("basePath", __DIR__);
 
 #
 # For those who don't know, this entire project
 # is just go get myself jump-started in programming -
 # I learned what a class is today, but I geeked out
 # when I learned that you can autoload them in PHP5 =)
 # 
 function __autoload($class) {
  include_once 'app/library/' . $class . '.php';
 }
 
 #
 # Don't forget to include the sources of data. Those
 # are *kinda* important. I think. Don't even ask, k?
 #
 include 'config/database.php';
 include 'config/motion.php';
 
 #
 # And the rest? The rest was history. Or routing code
 # Who cares about either of the two? Not me.
 #
 if ( isset($_GET["view"]) ) { $view = $_GET["view"]; } else { $view = "splash"; }
 
 switch ($view) {
  case "splash":
   include 'app/views/splash.php';
   break;
 
  case "cameras":
   include 'app/views/cameras.php';
   break;
  
  case "events":
   include 'app/views/events.php';
   break;
   
  case "status":
   include 'app/views/status.php';
   break;
   
  case "preferences":
   include 'app/views/preferences.php';
   break;
   
  default:
   header('Location: /');
 }
 
?>